package cloud.maque.querylist.dal.impl;

import cloud.maque.querylist.dal.domain.entity.Room;
import cloud.maque.querylist.dal.grpc.interfaces.RoomRpcService;
import cloud.maque.querylist.dal.interfaces.RoomService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author zhuyf
 * @date 2022/6/30 9:10
 */

@Service
public class RoomRpcServiceImpl implements RoomRpcService {

    @Autowired
    RoomService roomService;

    @Override
    public Room roomAdd(Room room) {
        return roomService.roomAdd(room);
    }

    @Override
    public Room roomEdit(Room room) {
        roomService.updateById(room);
        return room;
    }

    @Override
    public List<Room> roomList() {
        return roomService.roomList();
    }

    @Override
    public Boolean roomDelete(String roomId) {
        return roomService.removeById(roomId);
    }
}
